package com.zsxb.crm.controller;

import com.zsxb.crm.annotation.Log;
import com.zsxb.crm.dto.TransferPageDTO;
import com.zsxb.crm.mapper.ClueMapper;
import com.zsxb.crm.result.PageResult;

import com.zsxb.crm.result.Result;
import com.zsxb.crm.service.TransferService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/transfer")
@Slf4j
public class TransferController {


    @Autowired
    private TransferService transferService;
    @Autowired
    private ClueMapper clueMapper;

    @GetMapping("/list")
    public PageResult pageQuery(TransferPageDTO transferPageDTO){
        log.info("分页查询转派记录：{}",transferPageDTO);
        PageResult pageResult = transferService.pageQuery(transferPageDTO);
        return PageResult.success(pageResult);
    }

    @PutMapping("/assignment/0/21/{userId}")
    @Log
    public Result assignment(String userId){
        log.info("转派：{}",userId);
        return Result.success();
    }

    @PutMapping("/assignment/{cOrB}/{isUserId}/{outUserId}")
    @Log
    public Result assignment(@PathVariable Long cOrB,@PathVariable Long isUserId,@PathVariable Long outUserId){
       transferService.assignment(cOrB,isUserId,outUserId);
        return Result.success();
    }
}
